package leetcode.code153;

public class Solution2 extends Solution153 {

	@Override
	public int findMin(int[] nums) {
		int l = 0;
		int r = nums.length - 1;
		while (l < r) {
			int m = ((r - l) >> 1) + l;
			if (nums[m] < nums[r]) {
				r = m;
			} else {
				l = m + 1;
			}
		}
		return nums[l];
	}

	public static void main(String[] args) {
		Solution2 so = new Solution2();
		so.debug1();
		so.debug2();
		so.debug3();

	}

}
